include:
  - libmemcached.install
phpmemcached_install:
  file.managed:
    - name: /usr/local/src/memcached-2.2.0.tgz
    - source: salt://phpmemcached/files/memcached-2.2.0.tgz
    - user: root
    - group: root
    - mode: 644
  cmd.run:
    - name: cd /usr/local/src && sudo tar xf memcached-2.2.0.tgz && cd memcached-2.2.0 && /usr/local/php5/bin/phpize && sudo ./configure --with-php-config=/usr/local/php5/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached  --disable-memcached-sasl && sudo make && sudo make install
    - unless: test -f /usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/memcached.so
    - require:
      - file: phpmemcached_install
/usr/local/php5/etc/php.ini:
  file.append:
    - text: 
      - extension=memcached.so

